package com.example.chatrecommendation.bean.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户表
 * @Date 2024-03-07 17:23:10
 * @author Jasmine-drs
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
@ApiModel(value="User对象", description="用户表")
public class User implements Serializable {

    @NotNull(message="[索引]不能为空")
    @ApiModelProperty("索引")
    private Integer id;

    @NotBlank(message="[姓名]不能为空")
    @Size(max= 255,message="编码长度不能超过255")
    @ApiModelProperty("姓名")
    private String name;

    @NotBlank(message="[账号]不能为空")
    @Size(max= 10,message="编码长度不能超过10")
    @ApiModelProperty("账号")
    private String account;

    @NotBlank(message="[密码]不能为空")
    @Size(max= 32,message="编码长度不能超过32")
    @ApiModelProperty("密码")
    private String password;

    @NotNull(message="[创建时间]不能为空")
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @NotNull(message="[修改时间]不能为空")
    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}
